<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        span {
            display: inline-block;
            line-height: 30px;
            font-size: 30px;
            width: 30px;
            height: 30px;
        }
    </style>
</head>

<body>

    <script>
        //左下三角形
        for(var i = 1;i <= 9;i++){
            for(var j = 0;j < i;j++){
                document.write("<span>※</span>")
            }
            document.write("<br>")
        }
        document.write("<br>")

        //左上三角形
        for(var i = 1;i <= 9;i++){
            for(var j = 9;j >= i;j--){
                document.write("<span>※</span>")
            }
            document.write("<br>")
        }
        document.write("<br>")

        //右上三角形
        for(var i = 1;i <= 9;i++){
            for(var k = 1;k < i;k++){
                document.write("<span></span>")
            }
            for(var j = 9;j >= i;j--){
                document.write("<span>※</span>")
            }
            document.write("<br>")
        }
        document.write("<br>")

        //右下三角形
        for(var i = 1;i <= 9;i++){
            for(var k = i;k < 9;k++){
                document.write("<span></span>")
            }
            for(var j = 1;j <= i;j++){
                document.write("<span>※</span>")
            }
            document.write("<br>")
        }
        document.write("<br>")

        // 等腰三角形
        for(var i = 1; i <= 9; i++){
            for(var k = i;k < 9;k++){
                document.write("<span></span>")
            }
            for(var j = 1;j <= i + i -1;j++){
                document.write("<span>※</span>")
            }

            document.write("<br>")
        }
        document.write("<br>")

        // 菱形
        for (var i = 1; i <= 9; i++) {
            for (var k = i; k < 9; k++) {
                document.write("<span></span>")
            }
            for (var j = 1; j <= i + i - 1; j++) {
                document.write("<span>※</span>")
            }
            document.write("<br>")
        }
        for (var i = 1; i < 9; i++) {
            for (var k = 1; k <= i; k++) {
                document.write("<span></span>")
            }
            for (var j = i + i - 1; j < 16; j++) {
                document.write("<span>※</span>")
            }
            document.write("<br>")
        }
    </script>
</body>

</html>